#include <set>
#include <sstream>
#include <string.h>
#include <iostream>

using namespace std;

class Bucket {


public:
	int value;
	set<int> elements;

	Bucket() {
		this->value = 1;
	}

	Bucket(int value) {
		this->value = value;
	}

	string to_string() {
		stringstream out;
		out << this->value << "  [";
		for (set<int>::iterator it = elements.begin(); it != elements.end(); it++) {
			out << (*it) << ",";
		}
		out <<"]";

		return out.str();
	}

	void append(int element) {
		cerr << "append el" << endl;
		this->elements.insert(element);
	}

	int first_element() {
		if (!this->elements.empty()) {
			return *elements.begin();
		} else {
			return NULL;
		}
	}

	bool has_elements() {
		return this->elements.size() > 0;
	}

	void remove(int element) {
		cerr << "bucket.remove()" << endl;
		this->elements.erase(elements.find(element));
	}

	bool operator==(Bucket other) const{
		return this->value == other.value;
	}
};



